package me.a02mytreemap;

import java.util.TreeMap;

public class A02_TreeMapDemo2 {
    public static void main(String[] args) {
        //按照学生的年龄进行升序排序
        //自定义对象
        TreeMap<Student2, String> tm = new TreeMap<>();

        Student2 s1 = new Student2("zhangsan", 23);
        Student2 s2 = new Student2("lisi", 24);
        Student2 s3 = new Student2("wangwu", 25);

        tm.put(s1, "浙江");
        tm.put(s2, "江苏");
        tm.put(s3, "上海");

        System.out.println(tm);
    }
}
